package me.bemayor.components.twin;

import me.bemayor.api.customitem.CustomItemStack;
import me.bemayor.components.ComponentManagement;
import me.bemayor.components.ComponentMember;
import me.bemayor.components.twin.commands.TwinCommands;
import me.bemayor.components.twin.items.PortableTwinBox;
import me.bemayor.components.twin.items.TwinMaker;

import java.util.ArrayList;
import java.util.List;

public class Twin extends ComponentMember {
    public static final List<String> itemIdList = new ArrayList<>();//本组件的自定义物品ID列表

    //孪生算法定义
    //public TwinUsage usage = new TwinUsage();


    //物品定义：便携孪生箱、孪生制造机
    public final CustomItemStack PORTABLE_TWIN_BOX = new PortableTwinBox();
    public final CustomItemStack TWIN_MAKER = new TwinMaker();


    //指令定义
    public final TwinCommands commands;

    public Twin(ComponentManagement componentManagement) {
        super(componentManagement);
        commands = new TwinCommands(manager, itemIdList);
    }


    //组件注册
    public void registry() {
        //物品注册
        itemIdList.add(PORTABLE_TWIN_BOX.getId());
        ComponentManagement.registryItem(PORTABLE_TWIN_BOX);

        itemIdList.add(TWIN_MAKER.getId());
        ComponentManagement.registryItem(TWIN_MAKER);
        manager.registryRecipe(TWIN_MAKER.getRecipe());


        //指令注册
        ComponentManagement.registrySubCommand(commands.getCommand());
    }
}
